#include "WaterWindow.h";

WaterWindow::WaterWindow(SdkTrayManager *mTrayMgr)
{
	this->mTrayMgr = mTrayMgr;

	windowCaption = mTrayMgr->createLabel(OgreBites::TL_LEFT, "TWaterWindowCaption", "Edit water parameters:", 350);

	menuItems.push_back("Max particles");
	menuItems.push_back("Kernel radius multiplier");
	menuItems.push_back("Rest particles per metre");
	menuItems.push_back("Packet Size Multiplier");
    menuItems.push_back("Motion Limit Multiplier");
	menuItems.push_back("Collision Distance Multiplier");
	menuItems.push_back("Stiffness");
	menuItems.push_back("Viscosity");
	menuItems.push_back("Rest Density");
	menuItems.push_back("Start height");
	menuItems.push_back("Particle Lifetime");
	menuItems.push_back("Rate");
	menuItems.push_back("Fluid Speed");
	menuItems.push_back("Replusion Coefficient");
	menuItems.push_back("Dimension X");
	menuItems.push_back("Dimension Y");
	menuItems.push_back("Particle Size");

	mWaterMenu = mTrayMgr->createLongSelectMenu(OgreBites::TL_LEFT, "TWaterWindowMenu", "Parameter: ", 350, 200, 20, menuItems);

	mParamValueLabel = mTrayMgr->createLabel(OgreBites::TL_LEFT, "TParamValueLabel", "Value: ", 350);

	mUpButton = mTrayMgr->createButton(OgreBites::TL_LEFT,"TUpButton","+",40);
	mDownButton = mTrayMgr->createButton(OgreBites::TL_LEFT,"TDownButton","-",40);
}

//------------------------------------------------------------------------------------------

WaterWindow::~WaterWindow(void)
{
}

//-------------------------------------------------------------------------------------------

void WaterWindow::show(void)
{
	mTrayMgr->moveWidgetToTray(windowCaption,OgreBites::TL_LEFT);
	windowCaption->show();
	mTrayMgr->moveWidgetToTray(mWaterMenu,OgreBites::TL_LEFT);
	mWaterMenu->show();
	mTrayMgr->moveWidgetToTray(mParamValueLabel,OgreBites::TL_LEFT);
	mParamValueLabel->show();
	mTrayMgr->moveWidgetToTray(mUpButton,OgreBites::TL_LEFT);
	mUpButton->show();
	mTrayMgr->moveWidgetToTray(mDownButton,OgreBites::TL_LEFT);
	mDownButton->show();
}

//-------------------------------------------------------------------------------------------

void WaterWindow::hide(void)
{
	mTrayMgr->removeWidgetFromTray(windowCaption);
	windowCaption->hide();
    mTrayMgr->removeWidgetFromTray(mWaterMenu);
	mWaterMenu->hide();
    mTrayMgr->removeWidgetFromTray(mParamValueLabel);
	mParamValueLabel->hide();
    mTrayMgr->removeWidgetFromTray(mUpButton);
	mUpButton->hide();
    mTrayMgr->removeWidgetFromTray(mDownButton);
	mDownButton->hide();
}

//-------------------------------------------------------------------------------------------

WaterWindow::eWaterParams WaterWindow::getSelection(void)
{
	return (eWaterParams)mWaterMenu->getSelectionIndex();
}

//-------------------------------------------------------------------------------------------